<template>
	<view class="my">
		<headerTop title="我的"></headerTop>
		<!-- <view class="my_header">
			<view class="con_auto">
				<view class="name">
					{{ userInfo.name }}
					<text class="grey_color size24">v1.0</text>
				</view>
				<view class="desc font28">
					{{ userInfo.user_id }}
				</view>
			</view>
		</view> -->
		<view class="my_item">
			<u-cell-group>
				<block v-for="(item, index) in item_value" :key="index">
					<u-cell
						:icon="item.icon"
						:title="item.title"
						:value="item.value == '' ? '' : item.value"
						:label="item.label == '' ? '' : item.label"
						:isLink="item.isLink"
						:url="item.url"
					></u-cell>
				</block>
			</u-cell-group>
		</view>
		<view class="version">
			{{ app_version }}
		</view>
		<workTabbar :value="1"></workTabbar>
	</view>
</template>

<script>
import { mapState } from 'vuex';
export default {
	data() {
		return {
			item_value: [
				{
					title: '个人设置',
					icon: 'setting-fill',
					value: '',
					label: '',
					isLink: true,
					url: '/pages/work/user_setting/user_setting'
				},
				{
					title: '计划模板',
					icon: 'chat-fill',
					value: '',
					label: '',
					isLink: true,
					url: '/pages/work/template/template'
				},
				{
					title: '赠送优惠券',
					icon: 'coupon',
					value: '',
					label: '',
					isLink: true,
					url: '/pages/work/coupon/coupon'
				}
			],
			app_version: '1.0.0'
		};
	},
	onLoad() {
		this.$initConfig();
		let app_info = uni.getAccountInfoSync();
		// #ifdef MP-WEIXIN
		if (app_info.miniProgram.envVersion === 'release') {
			this.app_version = app_info.miniProgram.version;
		}
		// #endif
	},
	computed: {
		...mapState(['userInfo'])
	},
	methods: {}
};
</script>

<style lang="scss" scoped>
.my {
	&_header {
		background-color: #fff;
		padding: 24rpx 0;
		.name {
			text {
				margin-left: 20rpx;
			}
		}
		.desc {
			color: $common-grey-color;
		}
	}
	&_item {
		// margin-top: 24rpx;
		background-color: #fff;
	}
}
.version {
	text-align: center;
	margin-top: 40rpx;
	font-size: 24rpx;
	color: rgba(51, 51, 51, 0.5);
}
</style>
